<template>
  <div class="mod-config">
    <table-view ref="view"
                :searchAttrs="searchAttrs"
                :primaryKey="primaryKey"
                :listApiName="listApiName"
                :deleteApiName="deleteApiName"
                :saveAuthName="saveAuthName"
                :deleteAuthName="deleteAuthName"
                :showAttrs="showAttrs"
                :exportApiName="exportApiName"
                :sumInfo='sumInfo'
    >
    </table-view>
    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
  </div>
</template>


<script>
  import tableView from '@/components/tableView'
  import basicMixins from '@/utils/commonViewMixins'
  import AddOrUpdate from './weighdetailinfo-add-or-update'

  export default {
    mixins: [basicMixins],
    data() {
      return {
        primaryKey: 'id',
        listApiName: 'weighApi/purchaseWeighDetailInfoList',
        deleteApiName: 'weighApi/deleteWeighDetailInfo',
        saveAuthName: 'weigh:weighdetailinfo:save',
        deleteAuthName: 'weigh:weighdetailinfo:delete',
        exportApiName: 'weighApi/exportWeighDetailListBySupplierId',
        searchAttrs: {
          planOrderId: {
            label: "计划单",
            placeholder:"请输入计划单号",
            type: 'autoComplete',
            querySearchApiName: 'planApi/getPurchasePlanOrderInfoList'
          },
          supplierId: {
            label: "供货单位",
            placeholder: "请输入供货单位",
            type: 'autoComplete',
            querySearchApiName: 'supplierApi/getSupplierList'
          },

          dateTimeRange: {
            type: 'date',
            label: '时间范围',
            dateType: 'datetimerange',
            defaultTime: ['06:00:00', '08:00:00'],
            clearable: true
          },
   /*       sysDictId: {
            label: "货物名称",
            placeholder:"请输入货物名称",
            type: 'autoComplete',
            querySearchApiName: 'systemApi/getSysDictInfoList'
          },*/
          driverId: {
            label: "驾驶员",
            placeholder:"请输入驾驶员姓名",
            type: 'autoComplete',
            querySearchApiName: 'driverApi/getDriverInfoList'
          },
        },
        sumInfo: {leaveTime: 'netWeight'},
        showAttrs: {
          weighDetailNo: {
            label: "记录单号",
            width: 140
          },
          entranceTime: {
            label: "入场时间",
            type:'date',
            width: 100
          },
          licensePlateNo: {
            label: "车牌",
            width: 100
          },
          planOrderNo: {
            label: "计划单"
          },
          sysDictName: {
            label: "产品名称"
          },
          grossWeight: {
            label: "毛重"
          },
          tareWeight: {
            label: "皮重"
          },
          type: {
            label: "类型"
          },
          leaveTime: {
            label: "出场时间",
            type:'date'
          },
          netWeight: {
            label: "净重"
          },
          buckleWeight: {
            label: "扣重"
          },
          materialPriceId: {
            label: "价格"
          },
          driverName: {
            label: "驾驶员"
          },
          supplierName: {
            label: "供应商"
          },
          amount: {
            label: "金额"
          },
          remark: {
            label: "备注"
          },
        }
      }
    },
    components: {
      tableView,
      AddOrUpdate
    }
  }
</script>
